package com.bdqn.zhang.service;

import com.bdqn.zhang.dao.SysUserDao;
import com.bdqn.zhang.entity.SysUser;

import java.util.List;

public class SysUserServiceImpl implements SysUserService {


    private SysUserDao sysUserDao;

    public void setSysUserDao(SysUserDao sysUserDao) {
        this.sysUserDao = sysUserDao;
    }

    @Override
    public void addSysUser(SysUser sysUser) {
        sysUserDao.addSysUser(sysUser);
    }

    @Override
    public SysUser findUser(SysUser sysUser) {
       return sysUserDao.findUser(sysUser);
    }

    @Override
    public List<SysUser> findAllUser(Integer page,Integer limit) {
        List<SysUser> userList = null;
        try {
            userList = sysUserDao.findAllUser(page,limit);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return userList;
    }

    @Override
    public Long getUserCount() {
        Long count = null;
        try {
            count =  sysUserDao.getUserCount();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return count;
    }
}
